package com.lagou.repository;

import com.lagou.entity.COrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author mcl
 * @date 2021/9/13 14:56
 * @description
 */
public interface COrderRepository extends JpaRepository<COrder,Long> {

    @Query(value = "select * from c_order where status = 'Paying' and user_id = ?1 and product_id = ?2",nativeQuery = true)
    List<COrder> findBySql(Integer userId, Long productId);
}
